import { defHttp } from '@/utils/http/axios';

// 查询发布小程序列表
export function getList(query, data) {
  return defHttp.post({
    url: '/ma/manage/list',
    method: 'post',
    params: query,
    data: data,
  });
}

// 提交代码
export function submitAudit(id) {
  return defHttp.post({
    url: '/ma/manage/submitAudit/' + id,
    method: 'post',
  });
}

// 上传代码
export function uploadCode(id) {
  return defHttp.post({
    url: '/ma/manage/uploadCode/' + id,
    method: 'post',
  });
}

// 查询审核状态
export function queryStatus(id) {
  return defHttp.post({
    url: '/ma/manage/queryStatus/' + id,
    method: 'post',
  });
}

// 回退上一个版本
export function revertCodeRelease(id) {
  return defHttp.post({
    url: '/ma/manage/revertCodeRelease/' + id,
    method: 'post',
  });
}

// 小程序授权列表
export function getAuthList(query, data) {
  return defHttp.post({
    url: '/ma/manage/auth',
    method: 'post',
    params: query,
    data: data,
  });
}

// 审核通过
export function submitPublish(id) {
  return defHttp.post({
    url: '/ma/manage/publish/' + id,
    method: 'post',
  });
}

// 小程序发布
export function release(id) {
  return defHttp.post({
    url: '/ma/manage/release/' + id,
    method: 'post',
  });
}

// 新增二维码规则
export function addJumpQRCode(id) {
  return defHttp.post({
    url: '/ma/manage/addJumpQRCode/' + id,
    method: 'post',
  });
}
